Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[google_maps_flutter_ios]: Add swift package manager compatibility #8288

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jokerttu
Copy link
Contributor

Makes google_maps_flutter_ios available as a Swift Package to Flutter for iOS 15+ while maintaining compatibility with CocoaPods for iOS 14+.

It follows the same pattern used for other packages in the repository to ensure consistency.

The GoogleMapsUtils library introduces a separate target for Objective-C when using Swift Package Manager (SPM). As a result, package imports are handled differently depending on whether CocoaPods or SPM is used. This is controlled using the FGM_USING_COCOAPODS flag, which is defined in the package's Podfile.

Closes #146920

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@jokerttu
Copy link
Contributor Author

@cbracken
Swift Package Manager (SPM) works only with iOS15+
But CocoaPods still can be used with iOS14 with older GoogleMaps and GoogleMapsUtils versions.

Seems like the CI runs tests with
flutter config --enable-swift-package-manager
meaning that tests for iOS14 will fail as it GoogleMaps and GoogleMapsUtils for SPM require iOS15.

NOTE: There is two integration test sets, one for iOS14 and one for iOS15,

I did removed 'OCMock' pod only for iOS15 example (and replaced with swift package) as SPM cannot be used with iOS14 example.

TestRunnerUI is not available for iOS15, so these tests are runned only for iOS14 at the moment (with cocoapods packages).

Should iOS14 support be dropped for CocoaPods as well (even when it works?)
(and should there be iOS16 tests as well?)

@jokerttu jokerttu marked this pull request as ready for review December 13, 2024 14:02
@jokerttu jokerttu requested a review from cbracken as a code owner December 13, 2024 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[google_maps_flutter_ios] Add Swift Package Manager compatibility to google_maps_flutter_ios
1 participant